<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>foreach的使用</title>
</head>

<body>
    <script>
        const arr = [1, 2, 3, 4, 5]
        // foreach遍历数组，没有返回值，相当于加强的for
        arr.forEach((item, index) => {
            console.log(item, index);
        })
    </script>
</body>

</html>